<?php

namespace App\Http\Controllers\Api\Syj;

use App\Common\Responses;
use App\Http\Controllers\Controller;
use App\Utils\Service\Syj\LiveService;
use Illuminate\Http\Request;

class LiveController extends Controller
{
    //房东直播间推流地址
    function pushUrl(Request $request){
        //获取推流地址
        $name = $request->get('name');
        if(empty($name))return Responses::error('请输入直播间的名称');
        $live = new LiveService();
        return Responses::success($live->PushUrl($name));
    }
    //房东直播间播流地址
    function liveUrl(Request $request){
        $live = new LiveService();
        $name= $request->get('name');
        if (empty($name))return Responses::error('没有找到该直播间');
        return Responses::success($live->LiveUrl($name));
    }
}
